#include <bits/stdc++.h>
using namespace std;
int n;
int main(void){
    while(~scanf("%d",&n)){
        int p=1;
        int ans=1;
        p*=2;
        while(p!=1){
            ans++;
            if(p<=n){
                p*=2;
            }else{
                p-=(2*n-p+1);
            }
        }
        printf("%d\n",ans);
    }
    return 0;
}